package pl.basesoft.domain.vo;

import javax.persistence.Column;

import pl.basesoft.domain.GenericEntity;


public class Address extends GenericEntity{
	
	@Column
	String street;
	
	@Column
	String province;
	
	@Column
	String country;
	
	@Column
	Integer houseNumber;
	
	@Column
	Integer aprtamentNumber;
	
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((aprtamentNumber == null) ? 0 : aprtamentNumber.hashCode());
		result = prime * result + ((country == null) ? 0 : country.hashCode());
		result = prime * result
				+ ((houseNumber == null) ? 0 : houseNumber.hashCode());
		result = prime * result
				+ ((province == null) ? 0 : province.hashCode());
		result = prime * result + ((street == null) ? 0 : street.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Address other = (Address) obj;
		if (aprtamentNumber == null) {
			if (other.aprtamentNumber != null)
				return false;
		} else if (!aprtamentNumber.equals(other.aprtamentNumber))
			return false;
		if (country == null) {
			if (other.country != null)
				return false;
		} else if (!country.equals(other.country))
			return false;
		if (houseNumber == null) {
			if (other.houseNumber != null)
				return false;
		} else if (!houseNumber.equals(other.houseNumber))
			return false;
		if (province == null) {
			if (other.province != null)
				return false;
		} else if (!province.equals(other.province))
			return false;
		if (street == null) {
			if (other.street != null)
				return false;
		} else if (!street.equals(other.street))
			return false;
		return true;
	}
	
	
	
	
	
}
